package binary_tree.leetcode.easy;

/**
 * @author bruin_du
 * @description 二叉树的镜像
 * @date 2022/5/23 17:24
 **/
public class Offer27_MirrorTree {
    public TreeNode mirrorTree(TreeNode root) {
        if(root == null || (root.left == null && root.right == null)) return root;
        TreeNode left = mirrorTree(root.left);
        root.left = mirrorTree(root.right);
        root.right = left;
        return root;
    }
}
